--[[
    iOS
    采用逻辑分辨率
    https://blog.csdn.net/a18339063397/article/details/81482073
]]
local function LoadiPhoneScale()
  local ctn = 0
  local si = sysInit or {}
  local ratio = si.ratio or {}
  local siWidth = ratio.width or 540
  local siHight = ratio.height or 960
  if width == siWidth and height == siHight then
    ctn = 1    --正式
  else
    ctn = 0
  end
  return ctn
end

--[[
    Android
    采用逻辑分辨率: width == 540 and height == 960
    Dpi: 480dpi
]]
local function LoadAndroidRes()
  -- 资源：字库
end

local function LoadAndroidScale()
  LoadAndroidRes()
  local ctn = 0
  local si = sysInit or {}
  local ratio = si.ratio or {}
  local siWidth = ratio.width or 540
  local siHight = ratio.height or 960
  if width == siWidth and height == siHight then
    ctn = 1    --正式
  else
    -- dialog("暂不支持此设备 Android", 0)
    -- RxLog('      RxDeviceScale 暂不支持此设备 Android')
    ctn = 0
  end
  return ctn
end

local function LoadSimulatorScale()
  LoadAndroidRes()
  local ctn = 0
  local si = sysInit or {}
  local ratio = si.ratio or {}
  local siWidth = ratio.width or 540
  local siHight = ratio.height or 960
  if width == siWidth and height == siHight then
    ctn = 1
  else
    ctn = 0
  end
  return ctn
end

function RxDeviceScale()
  local ctn = 0
  local types = sysInit.deviceType
  if types == 1 then
    RxLog("当前设备为 iPhone")
    ctn = LoadiPhoneScale()
  elseif types == 2 then
    RxLog("当前设备为安卓真机")
    ctn = LoadAndroidScale()
  else
    RxLog("当前设备为安卓模拟器", 5)
    ctn = LoadSimulatorScale()
  end

  if ctn == 0 then
    dialog('请重新更改屏幕尺寸: 540x960')
  end
  return ctn
end